package com.gopay.common.logging;

import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.spi.LoggingEvent;
import org.fluentd.logger.FluentLogger;

/**
 * Extends Log4j appender to send log to fluentd
 * @author yangsun
 *
 */
public class FluentdLogAppender extends AppenderSkeleton {
	private static FluentLogger LOG = FluentLogger.getLogger("com.gopay.console.test", "192.168.1.220", 55555);
	
	@Override
	public void close() {
	}

	@Override
	public boolean requiresLayout() {
		return false;
	}

	@Override
	protected void append(LoggingEvent event) {
		LOG.log("log", "message", event.getMessage());
	}

}
